<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Get Cookies</title>
</head>
<body>
<h1>Cookies Information</h1>
<%
    // 获取所有的 Cookie
    Cookie[] cookies = request.getCookies();
    if (cookies != null) {
        out.println("<ul>");
        for (Cookie cookie : cookies) {
            out.println("<li><strong>Name:</strong> " + cookie.getName() +
                    ", <strong>Value:</strong> " + cookie.getValue() +
                    ", <strong>Domain:</strong> " + cookie.getDomain() +
                    ", <strong>Path:</strong> " + cookie.getPath() +
                    ", <strong>Max-Age:</strong> " + cookie.getMaxAge() +
                    ", <strong>Secure:</strong> " + cookie.getSecure() +
                    ", <strong>HttpOnly:</strong> " + cookie.isHttpOnly() +
                    "</li>");
        }
        out.println("</ul>");
    } else {
        out.println("<p>No cookies found.</p>");
    }
%>
</body>
</html>